package com.demo.infomutapp.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName：MyBatisPlusConfig
 * Package:IntelliJ IDEA
 * MP 分页插件配置
 *
 * @Author:Jixu
 * @Create:2023/1/29-11:06
 */
@Configuration // 配置类使用的注解
public class MyBatisPlusConfig {
    @Bean // 交给spring容器管理
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }
}